package com.fenghongzhang.kotlin1903.mvp.presenter

import com.fenghongzhang.kotlin1903.model.Food
import com.fenghongzhang.kotlin1903.mvp.contract.FoodContract
import com.fenghongzhang.kotlin1903.mvp.view.FoodActivity
import io.reactivex.Observer
import io.reactivex.disposables.Disposable

class FoodPresenter(v: FoodContract.IFoodView, m:FoodContract.IFoodModel) : BasePresenter<FoodContract.IFoodView, FoodContract.IFoodModel>(v,m) {

    fun getFood(){
        mModel.getFoodData(object : Observer<Food>{
            override fun onSubscribe(d: Disposable) {
            }

            override fun onNext(t: Food) {
                mView.initAdapter(t.data)
            }

            override fun onError(e: Throwable) {
            }

            override fun onComplete() {
            }

        })
    }
}